import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ActorsVO, ActorsForm, ActorsQuery } from '@/api/content/actors/types';

/**
 * 查询演员管理列表
 * @param query
 * @returns {*}
 */

export const listActors = (query?: ActorsQuery): AxiosPromise<ActorsVO[]> => {
  return request({
    url: '/content/actors/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询演员管理详细
 * @param actorId
 */
export const getActors = (actorId: string | number): AxiosPromise<ActorsVO> => {
  return request({
    url: '/content/actors/' + actorId,
    method: 'get'
  });
};

/**
 * 新增演员管理
 * @param data
 */
export const addActors = (data: ActorsForm) => {
  return request({
    url: '/content/actors',
    method: 'post',
    data: data
  });
};

/**
 * 修改演员管理
 * @param data
 */
export const updateActors = (data: ActorsForm) => {
  return request({
    url: '/content/actors',
    method: 'put',
    data: data
  });
};

/**
 * 删除演员管理
 * @param actorId
 */
export const delActors = (actorId: string | number | Array<string | number>) => {
  return request({
    url: '/content/actors/' + actorId,
    method: 'delete'
  });
};
